﻿using System;
using System.Collections.Generic;
using System.Text;

namespace MatthiWare.PortChecker
{
    [Serializable]
    public class PortInfo
    {
        public UInt16 PortNumber { get; set; }
        public String Name { get; set; }
        public String Description { get; set; }
        public Boolean Open { get; set; }
        public String Message { get; set; }

        public PortInfo()
            : this(new Port(), false, "")
        {

        }

        public PortInfo(Port port, bool open, String message)
        {
            PortNumber = port.PortNumber;
            Name = port.Name;
            Description = port.Description;
            Open = open;
            Message = message;
        }

        public override string ToString()
        {
            return String.Format("Port {0} ({1}): {2}", PortNumber, Name, Message);
        }
    }
}
